package com.hrvsr.common.util;

import java.util.LinkedList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class StrUtil {
	public static boolean isEmpty(String str) {
		if (str == null || str.trim().equals(""))
			return true;
		return false;
	}


	public static boolean isNotEmpty(String str) {
		return !isEmpty(str);
	}
	
	public static List<String> regexAll(String str, String pat) {
		List<String> arr = new LinkedList<String>();
		Pattern pattern = Pattern.compile(pat);
		Matcher m = pattern.matcher(str);
		while (m.find()) {
			arr.add(m.group());
		}
		return arr.isEmpty() ? null : arr;
	}

}
